import requests from '@/api/request'
// const SERVER_URL = 'user'
export default {
  // 业绩归属分页查询 v1/api/user/performance/find/page
  queryPreformanceList (data) {
    return requests({
      url: `/v1/api/user/performance/find/page`,
      method: 'post',
      data
    })
  },
  // 业绩归属新增分支行
  addPreformance (data) {
    return requests({
      url: `/v1/api/user/performance/add`,
      method: 'post',
      data
    })
  },
  // 根据id查询详情
  queryPreformanceDetails (data) {
    return requests({
      url: `/v1/api/user/performance/detail/${data}`,
      method: 'get'
    })
  },
  // 删除分支行
  deletePreformance (data) {
    return requests({
      url: `/v1/api/user/performance/delete/${data}`,
      method: 'delete'
    })
  },
  // 编辑分支行
  updatePreformance (data) {
    return requests({
      url: `/v1/api/user/performance/update`,
      method: 'put',
      data
    })
  },
  // 业绩归属机构分页
  queryPreformanceRelateList (data) {
    return requests({
      url: `/v1/api/user/performance/relate/find/page`,
      method: 'post',
      data
    })
  },
  // 添加业绩归属机构
  addPreformanceRelate (data) {
    return requests({
      url: `/v1/api/user/performance/relate/add`,
      method: 'post',
      data
    })
  },
  // 编辑业绩归属机构
  editPreformanceRelate (data) {
    return requests({
      url: `/v1/api/user/performance/relate/update`,
      method: 'put',
      data
    })
  },
  // 删除业绩归属机构
  deletePreformanceRelate (data) {
    return requests({
      url: `/v1/api/user/performance/relate/delete/${data}`,
      method: 'delete'
    })
  },
  // 查询机构树
  getQueryOrgTree () {
    return requests({
      url: `/v1/api/user/organization/open/queryTree/performance`,
      method: 'get'
    })
  }
}
